<template>
    <div>
      <form @submit.prevent="handleSubmit">
        <input type="text" v-model="inputValue" placeholder="请输入内容">
        <button type="submit">提交</button>
      </form>
      <p v-if="submittedValue">你提交的内容是：{{ submittedValue }}</p>
    </div>
  </template>
  
  <script setup>
  import { ref } from 'vue';
  
  const inputValue = ref('');
  const submittedValue = ref('');
  
  const handleSubmit = () => {
    submittedValue.value = inputValue.value;
    console.log('表单提交，提交的值为：', submittedValue.value);
  };
  </script>